<template>
  <div class="common-layout">

    <el-container>
      <el-aside width="200px">


        <el-menu active-text-color="#ffd04b" background-color="#545c64" class="left-menu" default-active="2"
          text-color="#fff" router>
          <!-- 只有一级目录 -->
          <el-menu-item index="/home">
            <el-icon>
              <document />
            </el-icon>
            <span>首页</span>
          </el-menu-item>
          <!-- 有一级和二级目录 -->

          <el-sub-menu index="/pro-man">
            <!-- 插槽--控制一级目录的标题 -->
            <template #title>
              <el-icon>
                <location />
              </el-icon>
              <span>商品管理</span>
            </template>
            <!--二级菜单  -->

            <el-menu-item index="/prolist">
              <el-icon>
                <document />
              </el-icon>商品列表
            </el-menu-item>
            <el-menu-item index="/proadd"><el-icon>
                <document />
              </el-icon>商品发布</el-menu-item>
          </el-sub-menu>
          <el-menu-item index="/usermanage">
            <el-icon>
              <document />
            </el-icon>
            <span>用户管理</span>
          </el-menu-item>

          <el-sub-menu index="/pro-man1">
            <!-- 插槽--控制一级目录的标题 -->
            <template #title>
              <el-icon>
                <location />
              </el-icon>
              <span>轮播图管理</span>
            </template>
            <!--二级菜单  -->

            <el-menu-item index="/swiperlist">
              <el-icon>
                <document />
              </el-icon>轮播图列表
            </el-menu-item>
            <el-menu-item index="/swiperadd"><el-icon>
                <document />
              </el-icon>轮播图添加</el-menu-item>
          </el-sub-menu>

        </el-menu>



      </el-aside>

      <el-container class="right-content">

        <el-header class="header">
          头部
        </el-header>

        <el-main>
          <!-- 右侧主体 会根据地址--改变 -->
          <!-- 创建页面组件--首页-商品列表-商品发布 -->
          <!-- 配置路由-layout里面的路由规则-嵌套路由--去layout的children里面配置 -->
          <router-view></router-view>
        </el-main>
      </el-container>

    </el-container>
  </div>
</template>

<script setup lang='ts'>

</script>

<style scoped>
.left-menu {
  height: 100vh;
}
.header{
  height: 5vh;
}
.right-content{
  height: 100vh;
}
</style>
